﻿using BLL;
using DAL.Engine;
using DAL.Mongo;
using DAL.NHibernate;
using StructureMap;

namespace DAL
{
    internal class RegisterByObjectFactory
    {
        internal static void Register()
        {
            ObjectFactory.Initialize(x =>
            {
#if MONGO
                x.AddRegistry<MongoRegistry>();
                x.AddRegistry<MongoTestRegistry>();
#elif NHIBERNATE
                x.AddRegistry<NHibernateRegistry>();
                x.AddRegistry<NHibernateTestRegistry>();
#endif
                x.AddRegistry<BLLRegistry>();
                x.Scan(s =>
                {
                    s.ExcludeNamespace("StructureMap");
                });
            });
        }
    }
}
